package com.cloudlead.common.lang.log;

import com.cloudlead.common.lang.api.ErrorMeta;

import java.util.Map;

/**
 * Created by dean on 2015/7/20.
 * <p>
 * 日志元数据
 */
public class LogMetadata {
    /**
     * 日志级别
     */
    private LogLevel level;
    /**
     * 时间戳
     */
    private long timestamp;
    /**
     * 线程名称
     */
    private String thread;
    /**
     * 触发用户
     */
    private String user;
    /**
     * 所执行的动作
     */
    private String action;
    /**
     * 请求编号
     */
    private String requestId;
    /**
     * 消息内容
     */
    private Map<String, Object> message;
    /**
     * 异常
     */
    private ErrorMeta error;

    public LogMetadata(LogLevel level, long timestamp, String thread, String user, String action, String requestId, Map<String, Object> message) {
        this.level = level;
        this.timestamp = timestamp;
        this.thread = thread;
        this.user = user;
        this.action = action;
        this.requestId = requestId;
        this.message = message;
    }

    public LogLevel getLevel() {
        return level;
    }

    public void setLevel(LogLevel level) {
        this.level = level;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public String getThread() {
        return thread;
    }

    public void setThread(String thread) {
        this.thread = thread;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public Map<String, Object> getMessage() {
        return message;
    }

    public void setMessage(Map<String, Object> message) {
        this.message = message;
    }

    public ErrorMeta getError() {
        return error;
    }

    public void setError(ErrorMeta error) {
        this.error = error;
    }
}
